import requests

class LlmModel:
    def __init__(self, base_url, token, timeout=30):
        self.base_url = base_url
        self.token = token
        self.timeout = timeout
        self.headers = {
            'Authorizatioin': f'Bearer {self.token}',
            'Content-Type': 'application/json'
        }
        # self.model_id = model_id
        # self.request_url = f'https://{IP}/api/cloud/aigc/v1.0/instances/{model_id}/'

    def get_model_list(self, data):
        url = f'{self.base_url}'
        response = requests.get(url, params=data, verify=False)
        return response
    def create_model(self, data):
        url = f'{self.base_url}'
        response = requests.post(url, json=data, headers=self.headers, timeout=self.timeout)
        return response
    def model_chat(self):
        pass

    def model_upgrade(self):
        pass

    def model_scale(self):
        pass

    def model_edit(self, model_id):
        url = f'{self.base_url}/{model_id}/edit'
        response = requests.post(url, headers=self.headers, timeout=self.timeout)
        return response

    def model_start(self, model_id):
        url = f'{self.base_url}/{model_id}/start'
        response = requests.post(url, headers=self.headers, timeout=self.timeout)
        return response

    def model_stop(self, model_id):
        url = f'{self.base_url}/{model_id}/stop'
        response = requests.post(url, headers=self.headers, timeout=self.timeout)
        return response
    def model_delete(self):
        pass